#include <stdio.h>
int main(){
	int n = 0;
	int x = 1;
	int y = 1;
	int z = 0;
	int b;
	scanf("%d",&b);
	for(int i=1;i<=b;i++){
	scanf("%d",&n);
	n=n-2;
	while(n>0){
		n--;
		z=y;
		y=x+y;
		x=z;
	}
	if(n==-1){
	y=0;
	}
	printf("%d\n",y);
	x=1;
	y=1;
	z=0;
	}
	return 0;
}
